<?php
	header("Content-Type:text/html;charset=utf-8");

	include_once("conn.php");
	class delLink{
	
			public function delL(){
				$sql="delete from link where webname='".$_POST["real_webname"]."'";
				$result=mysql_query($sql);
				if($result)
				{
					echo "分类下网址删除成功";
					echo "<br>";
					echo "删除的网址为:".$_POST["real_webname"]."";
					
				}
			
			}
	
	}

	class saveLink
	{
		public function saveL()
		{
			$sql="update link set webname='".$_POST["alias"]."',webaddress='".$_POST["alias_name"]."' where webname='".$_POST["real_webname"]."' ";
			
			mysql_query("set names utf-8");
			mysql_query($sql);
			echo "链接更新成功";


		}


	}

	if($_POST["save_link"]=="save")
	{
		$obj2=new saveLink();
		$obj2->saveL();
		echo "<br>";
		echo "<a href='index.php'>返回</a>";


	}

	if($_POST["del_link"]=="delete")
	{
		$obj=new delLink();
		$obj->delL();
		echo "<br>";
		echo "<a href='index.php'>返回</a>";

	}
?>